package org.abadirou.cdebacker.flst.entity;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;

import org.abadirou.cdebacker.flst.api.Personne;

@Entity(name = "Personne")
@NamedQueries({
	@NamedQuery(name ="PERSONNE_BY_NAME", query ="FROM Personne where nom = :nom"),
	@NamedQuery(name ="ALL_PERSONNE", query = "FROM Personne")
})
public class PersonneImpl implements Personne{

	public static final String PERSONNE_BY_NAME = "PERSONNE_BY_NAME";

	public static final String ALL_PERSONNE = "ALL_PERSONNE";

	private String nom;
	
	@Id
    @GeneratedValue(strategy=GenerationType.SEQUENCE)
    private long id;

	public PersonneImpl(){
		
	}
	
	public PersonneImpl(String nom) {
		this.nom = nom;
	}

	@Override
	public Long getId() {
		return id;
	}

	@Override
	public String getNom() {
		return nom;
	}

}
